<%@ include file="../includes/include.jsp"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%
	String uName = (String)session.getAttribute("uName");
%>
<html>
<head>
<title>list</title>
<link href="../style/xtable.css" type="text/css" rel="stylesheet">
<link href="../style/main.css" rel="stylesheet" type="text/css">
<script language="javascript">
function doAdd() {
	window.location.href="add.jsp";
}

function doLoad(id){
	window.location.href="TestUsers!load.action?id=" + id;;
}

function doDelete(id){
	if(event.returnValue=confirm("您确认执行删除操作么？")){
		window.location.href="TestUsers!delete.action?id=" + id;;
	}
}
</script> 

</head>
<body>
<p align="center">&nbsp;&nbsp;</p>

<table width="60%" align="center" class="linetable">
    <tr align="center" class="xf_query_tb_header">
      <td><%if(uName.equals("admin")){%><font style="cursor:hand;" title="添加管理员" onClick="doAdd()">添加</font>&nbsp;&nbsp;&nbsp;&nbsp;<%}%><a href="TestUsers!exit.action">退出</a></td>
    </tr>
</table>

<br/>

<table width="60%" align="center" class="linetable">
    <tr class="xf_query_tb_header">
      <td>用户名</td>
      <td>密码</td>
      <td>管理权限</td>
      <td>操作</td>
    </tr>

<s:if test="list!=null">
<s:iterator value="list" id="list" status="list"> 
<tr>
   <td>&nbsp;<s:property value="username"/></td>
   <td>&nbsp;<s:property value="password"/></td>
   <td>&nbsp;<s:property value="permission"/></td>
   <td align="center">
   
   <font style="cursor:hand;" title="点击修改" onClick='doLoad("<s:property value="id"/>")'>修改</font><%if(uName.equals("admin")){%>&nbsp;&nbsp;<font style="cursor:hand;" title="点击删除" onClick='doDelete("<s:property value="id"/>")'>删除</font><%}%></td>
</tr>
</s:iterator> 
</s:if>

</table>
</body>
</html>

